package com.hl.shifangzhiyu.web;

import com.hl.shifangzhiyu.pojo.sousuo1;
import com.hl.shifangzhiyu.service.sousuo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sousuo")
public class sousuoController {
    @Autowired
    private sousuo sousuo;
    @RequestMapping("search")
    public void search(@RequestParam String value) {
         sousuo.getvaue(value);
    }

    @RequestMapping("selectAll")
    public List<sousuo1> selectAll() {
        List<sousuo1> sousuo1s = sousuo.selectAll();
        return sousuo1s;
    }

    @RequestMapping("delete")
    public void delete() {
        sousuo.delete();
    }

    @RequestMapping("getUrl")
    public String getUrl(@RequestParam String value) {
       String url= sousuo.getUrl(value);
        System.out.println(url);
       return url;
    }
}
